#ifndef __SCNS_MEM_H__
#define __SCNS_MEM_H__

#include "ScnsConfig.h"

#if defined(SCNS_MEM_ENABLE)&&SCNS_MEM_ENABLE==1

#include "ScnsYing.h"

#if defined(__has_include)
#if __has_include("ScnsBspMem.h")

#include "ScnsBspMem.h"

#endif
#else
#include "ScnsBspMem.h"
#endif

#ifndef SCNS_MEM_ALIGNED
#define SCNS_MEM_ALIGNED 1
#endif

#if SCNS_MEM_ALIGNED<=0
#error
#endif
#ifndef scnsMemInvalidateDCache
#define scnsMemInvalidateDCache(addr,dsize) do{}while(0)
#endif
#ifndef scnsMemCleanDCache
#define scnsMemCleanDCache(addr,dsize)      do{}while(0)
#endif
#ifndef scnsMemCleanInvalidateDCache
#define scnsMemCleanInvalidateDCache(addr,dsize)      do{}while(0)
#endif

extern void*scnsMemcpy(void*dst,const void*src,size_t n);
extern void*scnsMemset(void*dst,int c,size_t n);
extern void*scnsMemcpyPlus(void*dst,const void*src,size_t n,size_t blockSize,size_t skipDst,size_t skipSrc);
extern int scnsMemcmp(const void*buf1,const void*buf2,size_t n);
extern int scnsStrcmp(const char*buf1,const char*buf2);
extern int scnsMemcmpRotate(const void*buf1,size_t len1,size_t st1,const void*buf2,size_t len2,size_t st2,size_t n);

#if defined(SCNS_TIMER_ENABLE)&&SCNS_TIMER_ENABLE==1
extern void scnsMemTest(const char name[],uint32*mem,const uint32 dataBias,const size_t size);
extern void scnsMemTestRo(const char name[],const uint32*mem,const size_t size,const uint16 checkTimes);
#endif

#endif
#endif
